package com.eascs.admin.o2o.o2ozx.trans;

import com.eascs.admin.o2o.loan.entity.O2oLoanUserEntity;
import com.eascs.admin.o2o.zx.entity.O2oLoanUserEntityZx;
import com.eascs.common.util.DateUtils;
import com.eascs.crm.common.custnew.entity.CustomerEntity;
import com.eascs.gaczcontract.entity.CustomerBasicInfo;
public class O2oUserZxTransFormart {

	
	/**
	 * CustomerBasicInfoEntity转换O2oLoanUserEntity
	 * @param o2oLoanUserEntity
	 * @param actionForm
	 * @return
	 */
	public static O2oLoanUserEntityZx customerNewToloanUser(O2oLoanUserEntityZx o2oLoanUserEntity, CustomerEntity customer, String id) {
		// o2oLoanUserEntity.setCustomerName(customer.getCustomerName());
		o2oLoanUserEntity.setDocumentNo(customer.getIdNumber());
		o2oLoanUserEntity.setDocumentType(customer.getIdType());
		o2oLoanUserEntity.setSex(customer.getSex());
		o2oLoanUserEntity.setLoanId(customer.getCustomerId());
		o2oLoanUserEntity.setUserFullName(customer.getCustomerName());
		o2oLoanUserEntity.setUserName(customer.getCustomerGivenName());
		o2oLoanUserEntity.setUserNamePinyin(customer.getCustomerNamePinyin());
		o2oLoanUserEntity.setUserPhone(customer.getMobileNumber());
		o2oLoanUserEntity.setUserSurName(customer.getCustomerFamilyName());
		o2oLoanUserEntity.setLicenseExpirationDate(customer.getLicenseExpirationDate());
		o2oLoanUserEntity.setSurnamePinyin(customer.getCustomerFamilyNamePy());
		o2oLoanUserEntity.setNamePinyin(customer.getCustomerGivenNamePy());
		o2oLoanUserEntity.setZxNo(id);
		return o2oLoanUserEntity;
	}
	
	
	public static O2oLoanUserEntityZx customerAdminToloanUser(O2oLoanUserEntityZx O2oLoanUserEntityZx, O2oLoanUserEntity o2oLoanUserEntity, CustomerBasicInfo info) {
		// o2oLoanUserEntity.setCustomerName(customer.getCustomerName());
		O2oLoanUserEntityZx.setDocumentNo(o2oLoanUserEntity.getDocumentNo());
		O2oLoanUserEntityZx.setDocumentType(o2oLoanUserEntity.getDocumentType());
		O2oLoanUserEntityZx.setSex(o2oLoanUserEntity.getSex());
		O2oLoanUserEntityZx.setLoanId(o2oLoanUserEntity.getLoanId());
		O2oLoanUserEntityZx.setUserFullName(o2oLoanUserEntity.getUserFullName());
		O2oLoanUserEntityZx.setUserName(o2oLoanUserEntity.getUserName());
		O2oLoanUserEntityZx.setUserNamePinyin(o2oLoanUserEntity.getUserNamePinyin());
		O2oLoanUserEntityZx.setUserPhone(o2oLoanUserEntity.getUserPhone());
		O2oLoanUserEntityZx.setUserSurName(o2oLoanUserEntity.getUserSurName());
		O2oLoanUserEntityZx.setSurnamePinyin(o2oLoanUserEntity.getSurnamePinyin());
		O2oLoanUserEntityZx.setNamePinyin(o2oLoanUserEntity.getNamePinyin());
		O2oLoanUserEntityZx.setLicenseExpirationDate(DateUtils.formateStandDate(info.getLicenseExpirationDate()));
		return O2oLoanUserEntityZx;
	}
	
}
